﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="SpecialQueries" targetNamespace="http://tempuri.org/SpecialQueries.xsd" xmlns:mstns="http://tempuri.org/SpecialQueries.xsd" xmlns="http://tempuri.org/SpecialQueries.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" GeneratorFunctionsComponentClassName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" UserFunctionsComponentName="QueriesTableAdapter" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Web.config" AppSettingsPropertyName="METUCMTDBConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="METUCMTDBConnectionString (Web.config)" ParameterPrefix="@" PropertyReference="AppConfig.System.Configuration.ConfigurationManager.0.ConnectionStrings.METUCMTDBConnectionString.ConnectionString" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="CourseAndReviewTeamsTableAdapter" GeneratorDataComponentClassName="CourseAndReviewTeamsTableAdapter" Name="CourseAndReviewTeams" UserDataComponentName="CourseAndReviewTeamsTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="METUCMTDBConnectionString (Web.config)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="FillByCourseId" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetDataByCourseId" GeneratorSourceName="FillByCourseId" GetMethodModifier="Public" GetMethodName="GetDataByCourseId" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetDataByCourseId" UserSourceName="FillByCourseId">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>select * from Courses c inner JOIN
Events e ON c.CourseId = e.ScheduleId inner JOIN ReviewTeams r ON r.EventId = e. EventId
WHERE c.CourseId = @courseId</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="courseId" ColumnName="CourseId" DataSourceName="METUCMTDB.dbo.Courses" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@courseId" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="CourseId" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="CourseId" DataSetColumn="CourseId" />
              <Mapping SourceColumn="CourseCode" DataSetColumn="CourseCode" />
              <Mapping SourceColumn="CourseName" DataSetColumn="CourseName" />
              <Mapping SourceColumn="Semester" DataSetColumn="Semester" />
              <Mapping SourceColumn="EventId" DataSetColumn="EventId" />
              <Mapping SourceColumn="ScheduleId" DataSetColumn="ScheduleId" />
              <Mapping SourceColumn="DueDate" DataSetColumn="DueDate" />
              <Mapping SourceColumn="Description" DataSetColumn="Description" />
              <Mapping SourceColumn="SubmissionRequiredFlag" DataSetColumn="SubmissionRequiredFlag" />
              <Mapping SourceColumn="ReviewTeamId" DataSetColumn="ReviewTeamId" />
              <Mapping SourceColumn="EventId1" DataSetColumn="EventId1" />
              <Mapping SourceColumn="RevievedTeamId" DataSetColumn="RevievedTeamId" />
              <Mapping SourceColumn="RevieverTeamId" DataSetColumn="RevieverTeamId" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources>
          <DbSource ConnectionRef="METUCMTDBConnectionString (Web.config)" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="GetUserPermission" MethodsParameterType="CLR" Modifier="Public" Name="GetUserPermission" QueryType="Scalar" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy" UserSourceName="GetUserPermission">
            <SelectCommand>
              <DbCommand CommandType="Text" ModifiedByUser="true">
                <CommandText>SELECT count(*) from [Permissions] p
where p.[Role] = (SELECT u.Role from Users u where u.UserName = @username) and p.Url = @url</CommandText>
                <Parameters>
                  <Parameter AllowDbNull="false" AutogeneratedName="url" ColumnName="Url" DataSourceName="METUCMTDB.dbo.Permissions" DataTypeServer="nvarchar(100)" DbType="String" Direction="Input" ParameterName="@url" Precision="0" ProviderType="NVarChar" Scale="0" Size="100" SourceColumn="Url" SourceColumnNullMapping="false" SourceVersion="Current" />
                  <Parameter AllowDbNull="false" AutogeneratedName="username" ColumnName="" DataSourceName="" DataTypeServer="varchar(10)" DbType="AnsiString" Direction="Input" ParameterName="@username" Precision="0" Scale="0" Size="10" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
                </Parameters>
              </DbCommand>
            </SelectCommand>
          </DbSource>
        </Sources>
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="SpecialQueries" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="SpecialQueries" msprop:Generator_UserDSName="SpecialQueries">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="CourseAndReviewTeams" msprop:Generator_TableClassName="CourseAndReviewTeamsDataTable" msprop:Generator_TableVarName="tableCourseAndReviewTeams" msprop:Generator_RowChangedName="CourseAndReviewTeamsRowChanged" msprop:Generator_TablePropName="CourseAndReviewTeams" msprop:Generator_RowDeletingName="CourseAndReviewTeamsRowDeleting" msprop:Generator_RowChangingName="CourseAndReviewTeamsRowChanging" msprop:Generator_RowEvHandlerName="CourseAndReviewTeamsRowChangeEventHandler" msprop:Generator_RowDeletedName="CourseAndReviewTeamsRowDeleted" msprop:Generator_RowClassName="CourseAndReviewTeamsRow" msprop:Generator_UserTableName="CourseAndReviewTeams" msprop:Generator_RowEvArgName="CourseAndReviewTeamsRowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="CourseId" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnCourseId" msprop:Generator_ColumnPropNameInRow="CourseId" msprop:Generator_ColumnPropNameInTable="CourseIdColumn" msprop:Generator_UserColumnName="CourseId" type="xs:int" />
              <xs:element name="CourseCode" msprop:Generator_ColumnVarNameInTable="columnCourseCode" msprop:Generator_ColumnPropNameInRow="CourseCode" msprop:Generator_ColumnPropNameInTable="CourseCodeColumn" msprop:Generator_UserColumnName="CourseCode" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="CourseName" msprop:Generator_ColumnVarNameInTable="columnCourseName" msprop:Generator_ColumnPropNameInRow="CourseName" msprop:Generator_ColumnPropNameInTable="CourseNameColumn" msprop:Generator_UserColumnName="CourseName" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="40" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Semester" msprop:Generator_ColumnVarNameInTable="columnSemester" msprop:Generator_ColumnPropNameInRow="Semester" msprop:Generator_ColumnPropNameInTable="SemesterColumn" msprop:Generator_UserColumnName="Semester" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="40" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="EventId" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnEventId" msprop:Generator_ColumnPropNameInRow="EventId" msprop:Generator_ColumnPropNameInTable="EventIdColumn" msprop:Generator_UserColumnName="EventId" type="xs:int" />
              <xs:element name="ScheduleId" msprop:Generator_ColumnVarNameInTable="columnScheduleId" msprop:Generator_ColumnPropNameInRow="ScheduleId" msprop:Generator_ColumnPropNameInTable="ScheduleIdColumn" msprop:Generator_UserColumnName="ScheduleId" type="xs:int" minOccurs="0" />
              <xs:element name="DueDate" msprop:Generator_ColumnVarNameInTable="columnDueDate" msprop:Generator_ColumnPropNameInRow="DueDate" msprop:Generator_ColumnPropNameInTable="DueDateColumn" msprop:Generator_UserColumnName="DueDate" type="xs:dateTime" minOccurs="0" />
              <xs:element name="Description" msprop:Generator_ColumnVarNameInTable="columnDescription" msprop:Generator_ColumnPropNameInRow="Description" msprop:Generator_ColumnPropNameInTable="DescriptionColumn" msprop:Generator_UserColumnName="Description" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="255" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="SubmissionRequiredFlag" msprop:Generator_ColumnVarNameInTable="columnSubmissionRequiredFlag" msprop:Generator_ColumnPropNameInRow="SubmissionRequiredFlag" msprop:Generator_ColumnPropNameInTable="SubmissionRequiredFlagColumn" msprop:Generator_UserColumnName="SubmissionRequiredFlag" type="xs:int" minOccurs="0" />
              <xs:element name="ReviewTeamId" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnReviewTeamId" msprop:Generator_ColumnPropNameInRow="ReviewTeamId" msprop:Generator_ColumnPropNameInTable="ReviewTeamIdColumn" msprop:Generator_UserColumnName="ReviewTeamId" type="xs:int" />
              <xs:element name="EventId1" msprop:Generator_ColumnVarNameInTable="columnEventId1" msprop:Generator_ColumnPropNameInRow="EventId1" msprop:Generator_ColumnPropNameInTable="EventId1Column" msprop:Generator_UserColumnName="EventId1" type="xs:int" />
              <xs:element name="RevievedTeamId" msprop:Generator_ColumnVarNameInTable="columnRevievedTeamId" msprop:Generator_ColumnPropNameInRow="RevievedTeamId" msprop:Generator_ColumnPropNameInTable="RevievedTeamIdColumn" msprop:Generator_UserColumnName="RevievedTeamId" type="xs:int" />
              <xs:element name="RevieverTeamId" msprop:Generator_ColumnVarNameInTable="columnRevieverTeamId" msprop:Generator_ColumnPropNameInRow="RevieverTeamId" msprop:Generator_ColumnPropNameInTable="RevieverTeamIdColumn" msprop:Generator_UserColumnName="RevieverTeamId" type="xs:int" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:CourseAndReviewTeams" />
      <xs:field xpath="mstns:CourseId" />
      <xs:field xpath="mstns:EventId" />
      <xs:field xpath="mstns:ReviewTeamId" />
    </xs:unique>
  </xs:element>
</xs:schema>